<%--
  Created by IntelliJ IDEA.
  User: zgl
  Date: 2022/4/9
  Time: 20:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
    <meta charset="utf-8">
    <title>管理员登录</title>
    <style type="text/css">
        html head{
            padding: 0;
            margin: 0;
        }
        table{
            background-color:#edeadb;
            border-radius: 15px;
            box-shadow: 10px 10px 10px grey;
            margin-top: 10px;
            padding: 30px;
        }
        .mylogin{
            display: flex;
            justify-content: center;
        }
        h1{
            text-align: center;
            margin-top: 120px;
        }
        tr td{
            padding: 10px;
        }
        tr td:first-child{
            text-align: right;
        }
        input {
            border-radius: 7px;
        }
        button{
            border-radius: 6px;
            margin-left: 30px;
        }
        img{
            width: 80px;
            height: 50px;
            margin-left: 9px;
        }
        .mycodeinput{
            width: 70px;
            margin-top: 13px;
        }
        .codekuang{
            display: flex;
        }
        .inputcodediv{
            height: 50px;
        }
    </style>
    <script type="text/javascript">
        function goRegister(){
            location.href ="register.jsp";
        }
        function getCode(img){
            img.src ="randomCode?y=" + new Date().getTime();
        }
    </script>
</head>
<body>
<h1>管理系统—登录</h1>
<c:if test="${param.status=='1'}">
    <span style="color: red">用户名或密码不能为空！</span>
</c:if>
<c:if test="${param.status=='2'}">
    <span style="color: red">用户名或密码不正确！</span>
</c:if>
<c:if test="${param.status=='3'}">
    <span style="color: red">验证码错误或为空！</span>
</c:if>
<c:if test="${param.status=='4'}">
    <span style="color: red">验证码过期，请点击图片重新输入！</span>
</c:if>
<div class="mylogin">
    <form action="login" method="post">
        <table>
            <tr>
                <td>用户名:</td>
                <td><input name="username"/></td>
            </tr>
            <tr>
                <td>密码:</td>
                <td><input name="password"/></td>
            </tr>
            <tr>
                <td>验证码:</td>
                <td>
                    <div class="codekuang">
                        <div class="inputcodediv">
                            <input class="mycodeinput" name="code"/>
                        </div>
                        <img src="randomCode" onclick="getCode(this)">
                    </div>
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <button type="submit">登录</button>
                    <button type="button" onclick="goRegister()">注册</button>
                </td>
                <td><a href="http://www.taobao.com" style="text-decoration: none;">忘记密码？</a></td>
            </tr>
        </table>
    </form>
</div>
</body>
</html>

